<?php
	include_once '../config.inc.php';
	$stmt = $pdo->prepare('select id,newdate,title,content from kp_news order by id desc');
	$stmt->execute();
	$arrNews = $stmt->fetchAll(PDO::FETCH_ASSOC);
	//print_r($arrNews);

?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<link rel="stylesheet" type="text/css" href="css/kpnews.css"/>
	<script src="../js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/kpnews.js" type="text/javascript" charset="utf-8"></script>
	<title>资讯管理</title>
</head>
<body>
	<div id="kpnews">
		<div class="title">
			后台管理->资讯管理
		</div>
		<ul class="newtitle">
			<li class="c1">序号</li>
			<li class="c2">标题</li>
			<li class="c3">内容</li>
			<li class="c4">操作</li>
		</ul>
		<div id="news">
			<?php 
				foreach($arrNews as $new){	
			?>
			
			<ul class="new">
				<li class="c1"><?php echo $new['id']; ?></li>
				<li contenteditable="true" class="c2"><?php echo $new['title']; ?></li>
				<li contenteditable="true" class="c3"><?php echo $new['content']; ?></li>
				<li class="newedit">[改]</li>
				<li class="newdel">[删]</li>
			</ul>
			<?php 
				}	
			?>
			
		</div>
		
		
		<ul id="addnew">
			<li class="c1"></li>
			<li contenteditable="true" class="c2"></li>
			<li contenteditable="true" class="c3"></li>
			<li class="newadd">[增加]</li>
		</ul>
		
	</div>
</body>
</html>